<?php


namespace app\appa\controller;


use app\common\controller\Api;
use think\facade\Filesystem;

class Upload extends Api
{
    public function upload()
    {
        //接收文件
        $image = request()->file('image');
        $result = Filesystem::disk('public')->putFile('image',$image);
        if ($result){
            return success('上传成功',[
                'url' => $result
            ]);
        }else{
            return error('上传失败');
        }
    }


}